<template>
  <div>
    <div>index</div>
    <template v-for="item in routes">
      <div class="itemSel" @click="routesPush(item)">{{`${item.name}--${item.component.__hmrId}`}}</div>
    </template>

  </div>
</template>

<script>
  export default {

    data() {
      return {
        title: '',
        routes: ''
      }
    },

    created() {
    },

    mounted() {
      console.log('==routes==', this.$router.options.routes)
      var routes=this.$router.options.routes
      this.routes=routes
			// 模拟跳转
      // setTimeout(()=>{
      //   var path=this.$router.options.routes[1].path
      //   this.$router.push(path)
      // },1200)
    },

    methods:{
      routesPush(item){
        var path=item.path;
        this.$router.push(path)
      },
    },

  }
</script>

<style scoped="scoped">
  .itemSel {
    border: 1px solid #0000FF;
    margin-bottom: 8px;
    padding: 2px;
  }
</style>
